package com.hl.toolkit.server.tycoin.common.enums;

/**
 * 任务状态
 *
 */
public enum SyncTaskStatusEnum {
    WAIT(1, "等待处理..."), HAS_SEND(2, "指令已发送"), SUCCESS(3, "处理成功"), FAIL(4, "处理失败"), TIMEOUT(5, "处理超时");

    int key;
    String value;

    SyncTaskStatusEnum(int key, String value) {
        this.key = key;
        this.value = value;
    }

    public int getKey() {
        return key;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static SyncTaskStatusEnum getEnumByKey(int key) {
        for (SyncTaskStatusEnum taskStatusEnum : SyncTaskStatusEnum.values()) {
            if (key == taskStatusEnum.getKey()) {
                return taskStatusEnum;
            }
        }
        return null;
    }

}
